/*
 * @Author: chunlai
 * @Date: 2023-12-19 16:58:33
 * @LastEditTime: 2025-09-04 18:34:40
 * @LastEditors: minsheng_insurance_agency_zhoucl
 * @FilePath: \02.bldinsure\src\mixins\notice.js
 * @Description:告知
 */
export const autoNoticeMixin = {
  data() {
    return {
      status: "",
      showMask: false,
    };
  },
  created() {
    this.$store.commit("updateLoad", false);
    this.getNoticeStatus();
  },
  methods: {
    showAction() {
      if (this.disabledEdit) {
        return;
      }
      this.showMask = true;
    },
    nextStep() {
      if (this.disabledEdit) {
        this.forbidChange();
        return;
      }
      if (this.status == "0") {
        this.toNextStep();
      } else if (this.status == "1") {
        this.$msAlert(`智能核保未通过,不可投保`);
      } else {
        this.$msAlert(`请完成智能核保的填写并如实告知`);
      }
    },
    getNoticeStatus() {
      this.$store
        .dispatch("apis/comAdminApiRequest", {
          apiParams: this.apiComParams,
          apiName: "getHealthNoticeResult",
          toast: true,
        })
        .then((data) => {
          this.status = data.noticeResult;
        });
    },
  },
};
